# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Contains benchmarks for SQL queries.
#

# Uncomment to enable concurrent garbage collection (GC) if you encounter long GC pauses.
JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false \
  -XX:+UseParNewGC \
  -XX:+UseConcMarkSweepGC \
  -XX:+UseTLAB \
  -XX:NewSize=128m \
  -XX:MaxNewSize=128m \
  -XX:MaxTenuringThreshold=0 \
  -XX:SurvivorRatio=1024 \
  -XX:+UseCMSInitiatingOccupancyOnly \
  -XX:CMSInitiatingOccupancyFraction=60 \
  -XX:+PrintGCDateStamps \
"

# Warning: database must be created and specified in URL explicitly, and there's no other way around as long as driver does not support changing DB in runtime
PGSQL_PARAMS="-jdbcDrv org.postgresql.Driver -jdbc jdbc:postgresql://127.0.0.1/pgbenchmark?user=postgres\\&password=1 -sch ${SCRIPT_DIR}/../config/pgsql-schema.sql"

# List of default probes.
# Add DStatProbe or VmStatProbe if your OS supports it (e.g. if running on Linux).
BENCHMARK_DEFAULT_PROBES=ThroughputLatencyProbe,PercentileProbe

# Packages where the specified benchmark is searched by reflection mechanism.
BENCHMARK_PACKAGES=org.yardstickframework,org.apache.ignite.yardstick

# Comma-separated list of the hosts to run BenchmarkServers on. 2 nodes on local host are enabled by default.
SERVER_HOSTS=localhost,localhost

# Comma-separated list of the hosts to run BenchmarkDrivers on. 1 node on local host is enabled by default.
DRIVER_HOSTS=localhost

# Run configuration.
# Note that each benchmark is set to run for 300 seconds (5 mins) with warm-up set to 60 seconds (1 minute).
CONFIGS="\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -w 60 -d 300 -t 64 ${PGSQL_PARAMS} -dn JdbcPutBenchmark -sn IgniteNode -ds jdbc-pgsql-put,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -w 60 -d 300 -t 64 ${PGSQL_PARAMS} -dn JdbcPutGetBenchmark -sn IgniteNode -ds jdbc-pgsql-put-get,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -w 60 -d 300 -t 64 ${PGSQL_PARAMS} -dn JdbcSqlQueryBenchmark -sn IgniteNode -ds jdbc-pgsql-query,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -w 60 -d 300 -t 64 ${PGSQL_PARAMS} -dn JdbcSqlQueryJoinBenchmark -sn IgniteNode -ds jdbc-pgsql-query-join,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -w 60 -d 300 -t 64 ${PGSQL_PARAMS} -dn JdbcPutIndexedValue8Benchmark -sn IgniteNode -ds jdbc-pgsql-put-indexed-8\
"
